package com.syn.synold4s.adapter;

import android.content.Context;

import com.gaoyi.basemodule.baseAdapter.BaseAdapter;
import com.gaoyi.basemodule.baseAdapter.BaseViewHolder;
import com.syn.synold4s.R;
import com.syn.synold4s.bean.dto.AlertDto;
import com.syn.synold4s.databinding.AlertItemBinding;

public class AlertAdapter extends BaseAdapter<AlertItemBinding, AlertDto> {
    public AlertAdapter(Context context) {
        super(context);
    }

    @Override
    protected void setBindingVariable(AlertItemBinding binding, int position) {
    }

    @Override
    protected void onBindItem(AlertItemBinding binding, AlertDto item, int position) {
        binding.tvAlertName.setText(item.getAlertName() != null ? item.getAlertName() : "");
        binding.tvAlertCon.setText(item.getReason() != null ? item.getReason() : "");
        binding.tvAlertTime.setText(item.getAlertAt() != null ? item.getAlertAt() : "");
    }

    @Override
    protected void onCreateView(AlertItemBinding binding, BaseViewHolder<AlertItemBinding> holder) {

    }

    @Override
    protected int getLayoutResId() {
        return R.layout.alert_item;
    }
}
